package components.contorls.superClass
{
	import components.core.UIComponent;

	/**
	 *图像和名称 
	 * @author zn
	 * 
	 */	
	public class BaseImageLabelItem extends UIComponent
	{
		private var _data:Object;
		
		/**
		 *设置数据时的回调
		 * function(this,data);
		 */
		public var dataFunction:Function;
		
		public function BaseImageLabelItem()
		{
		}
		
		public function get imageComp():BaseImage
		{
			return getChildByName("image") as BaseImage;
		}
		
		public function get labelComp():BaseLabel
		{
			return getChildByName("label") as BaseLabel;
		}
		
		public function get data():Object
		{
			return _data;
		}
		
		public function set data(value:Object):void
		{
			_data = value;
			
			if(dataFunction!=null)
				dataFunction.call(this,this,value);
		}
		
		public function set source(value:String):void
		{
			imageComp.source=value;
		}
		
		public function set labelStr(value:String):void
		{
			labelComp.text=value;
		}
	}
}